﻿using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Wpf.Netdisk.Models.BaseModel;
using Wpf.Netdisk.Models.Entity;
using Wpf.Netdisk.Services.Common;
using Wpf.Netdisk.Services.Interface;

namespace Wpf.Netdisk.Services.Implement
{
    public class NetdiskFolderService : BaseService<NetdiskFolderInfo>, INetdiskFolderService
    {
        private readonly HttpRestClient _client;

        public NetdiskFolderService(HttpRestClient client) : base(client, "netdiskfolderinfo")
        {
            this._client = client;
        }

        public async Task<ApiResult> UploadFile(IFormFile file)
        {
            BaseRequest request = new BaseRequest();
            request.Method = RestSharp.Method.Post;
            request.Route = $"baseadmin/netdiskfolderinfo/uploadfile";
            request.Parameter = file;
            return await _client.ExecuteAsync(request);
        }
    }
}
